package com.coin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.coin.domain.SysUserLog;
import com.coin.mapper.SysUserLogMapper;
import com.coin.service.SysUserLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.concurrent.*;

/**
 * @author 李力
 * @description 针对表【sys_user_log(系统日志)】的数据库操作Service实现
 * @createDate 2025-05-24 17:08:03
 */
@Service
public class SysUserLogServiceImpl extends ServiceImpl<SysUserLogMapper, SysUserLog>
        implements SysUserLogService {

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveAdminLog(SysUserLog sysUserLog) {
        if (sysUserLog != null) {
            ExecutorService executorService = Executors.newCachedThreadPool();
            executorService.submit(new Runnable() {
                @Override
                public void run() {
                    save(sysUserLog);
                }
            });
        }
    }
}




